<?php 
ini_set('max_execution_time',10000);
my_component_load('testing' , false);
my_component_load('paging' , false); 
my_component_load('xl_builder' , false);  
my_component_load('list_kalender' , false);   
my_component_load('rpt_jadwal_karyawan' );
$task = isset($_GET['task']) ? $_GET['task'] : "";  
$tanggal = isset($_GET['tanggal']) ? $_GET['tanggal'] : "";  
$field = isset($_GET['field']) ? $_GET['field'] : "";  
$value = isset($_GET['value']) ? $_GET['value'] : "";  
$id = isset( $_GET['id'] ) ? $_GET['id']:  0; 
$query = "SELECT MAX(periode_id) AS maxd FROM tmn_hari_realisasi LIMIT 1";
$result = my_query($query);
$row = my_fetch_array($result);
$periode_id = isset( $_GET['periode_id'] ) ? $_GET['periode_id']:   ($row['maxd'] );
$karyawan_id = isset( $_GET['karyawan_id'] ) ? $_GET['karyawan_id']:  0;  

$modulname = "Laporan _BN_ Waktu Kerja _BN_ Realisasi jadwal";
if($task == 'excel'){ 
	header("Content-Type: application/xls");
	header("Content-Disposition: attachment;filename=realisasi_waktu_kerja.xls");
	echo excel_hari_kerja($periode_id);
	exit;
}else{
	$content = list_karyawan_realisasi($periode_id);
}
generate_my_web($content, $pagename );